package 多线程.多线程;

public class ThreadDemo1 {
    private static class Threads extends Thread{
        @Override
        public void run() {
            while (true){
                System.out.println(Thread.currentThread().getName());
                try {
                    Thread.sleep(12);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public static void main(String[] args) {
        Threads t1 = new Threads();
        Threads t2 = new Threads();
        Threads t3 = new Threads();

        t1.start();
        t3.start();
        t2.start();

        while (true){
            System.out.println(Thread.currentThread().getName());
            try {
                Thread.sleep(12);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
